package com.shiyipicture.shiyipicturebackend.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService;
import com.shiyipicture.shiyipicturebackend.model.dto.user.UserQueryRequest;
import com.shiyipicture.shiyipicturebackend.model.entity.User;
import com.shiyipicture.shiyipicturebackend.model.vo.UserLoginVo;
import com.shiyipicture.shiyipicturebackend.model.vo.UserVO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
* @author Administrator
* @description 针对表【user(用户)】的数据库操作Service
* @createDate 2025-01-02 17:51:50
*/
public interface UserService extends IService<User> {

  /**
   * 用户注册
   * @param userAccount
   * @param userPassword
   * @param checkPassword
   * @return
   */
  long userRegister(String userAccount,String userPassword,String checkPassword);

  /**
   * 用户登录
   * @param userAccount
   * @param userPassword
   * @param checkPassword
   * @return
   */
  UserLoginVo userLogin(String userAccount, String userPassword, HttpServletRequest request);


  /**
   * 获取脱敏类的用户信息
   * @param user
   * @return
   */
  UserLoginVo getLoginUserVo(User user);

  /**
   * 获取脱敏类的用户信息
   * @param user
   * @return
   */
  UserVO getUserVo(User user);

  /**
   * 获取脱敏类的用户列表
   * @param userList
   * @return
   */
  List<UserVO> getUserVoList(List<User> userList);

  /**
   * 获取当前登录用户
   * @param request
   * @return
   */
  User getLoginUser(HttpServletRequest request);


  /**
   * 用户住校
   * @param request
   * @return
   */
  boolean userLogout(HttpServletRequest request);

  /**
   * 获取加密的密码
   * @param password
   * @return
   */
  String getEncryptPassword(String password);

  QueryWrapper<User> getQueryWrapper(UserQueryRequest userQueryRequest);
}
